package com.mc.service.did.impl;

import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.mc.dao.LeafIdDao;
import jakarta.annotation.PostConstruct;


/**
 * 号段容器
 */
@Component
public class SegmentContainer {

	public static final ConcurrentHashMap<String, SegmentManage> manages = new ConcurrentHashMap<>();
	
	@Autowired
	private LeafIdDao leafIdDao;
	
	@PostConstruct
	void init() {
		
		List<String> bizTags = leafIdDao.getAllBizTag();
		
		bizTags.forEach(bizTag ->{
			SegmentManage manage = new SegmentManage(bizTag);
			manages.put(bizTag, manage);
		});

	}
	
}
